/**
 * 
 */
package com.gragra.parseOptions;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
/**
 * a simple option the receives an arbitrary number of Strings as arguments and then be used to retrieve
 * them, the class returns true for hasBeenSet if there has been at least one call to processArguments
 * with a non-null argument
 * @author Christoph Teichmann
 * 22.04.2013
 */
public class ListOfStringsOption extends DescribeAtCreationOption
{
	/**
	 * used to hold the arguments
	 */
	private String[] data = null;
	/**
	 * returns the last array of arguments
	 * @return the data
	 */
	public String[] getData()
	{return this.data;}
	/**
	 * constructs a new instance with the given description
	 * @param description
	 */
	public ListOfStringsOption(String description)
	{super(description);}
	/* (non-Javadoc)
	 * @see com.gragra.parseOptions.OptionInformation#processArguments(it.unimi.dsi.fastutil.objects.ObjectArrayList)
	 */
	@Override
	public void processArguments(ObjectArrayList<String> arguments)
			throws CommandLineException
	{
		if(arguments != null && arguments.size() > 0)
		{this.data = arguments.toArray(new String[arguments.size()]);}
	}
	/* (non-Javadoc)
	 * @see com.gragra.parseOptions.OptionInformation#hasBeenSet()
	 */
	@Override
	public boolean hasBeenSet()
	{return this.data != null;}
}